gdkgl: Add gdk_gl_context_get_damage()
authorBenjamin Otte <otte@redhat.com>
Sun, 4 Dec 2016 15:33:13 +0000 (16:33 +0100)
committerBenjamin Otte <otte@redhat.com>
Mon, 5 Dec 2016 14:02:47 +0000 (15:02 +0100)
commit8915be00d13605c90669d4d84510d823aa0c52ab
tree7c31894066f8fd53b3378af7bcab821f838c8543
parent582ea50faaa7e7b9650815e9a64297b29e32efab
gdkgl: Add gdk_gl_context_get_damage()

This is a way to query the damaged area of the backbuffer.

The GL renderer uses this to compute the extents of that damage region
(computed via buffer age) and use them to minimize the area to redraw.

This changes the semantics of GL rendering to "When calling
gdk_window_begin_frame() with a GL context, the area by
gdk_gl_context_get_damage() needs to be redrawn and every other pixel of
the backbuffer is guaranteed to be correct.
After gdk_window_end_frame() on a GL-drawn window, the whole backbuffer
must be correct.

We can always glXBufferSwap() now because of this.
docs/reference/gdk/gdk4-sections.txt
gdk/gdkglcontext.c
gdk/gdkglcontext.h
gdk/gdkglcontextprivate.h
gdk/mir/gdkmirglcontext.c
gdk/wayland/gdkglcontext-wayland.c
gdk/x11/gdkglcontext-x11.c
gsk/gskglrenderer.c